<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //创建一个学生对象 名字  班级  学号
    let student ={
        name:"张三",
        bj:"03班",
        xh:123456789
    };
    console.log(student.name);
    console.log(student.bj);
    console.log(student.xh);
    //封装几个同学的信息
    let studentArr = [
        {name:"王五",sg:120,nj:"6年级"},
        {name:"老六",sg:270,nj:"12年级"},
        {name:"九妹",sg:210,nj:"三年级"}];
    //forof --->foreach
    for (let item of studentArr){
        let p = document.createElement("p");
        p.innerText="姓名:"+item.name+",身高:"+item.sg+",年级:"+item.nj;
        document.body.append(p);
    }

</script>
</body>
</html>